package dl.domainmodel.service;

import dl.common.service.iface.ContractServiceInterface;
import dl.domainmodel.model.Contract;
import dl.domainmodel.model.Product;
import dl.exception.handler.ApplicationException;
import dl.martinfowler.wrapper.MfDate;
import dl.martinfowler.wrapper.Money;

public class ContractService implements ContractServiceInterface {

	@Override
	public long insertContractInformation(long productNumber, Money revenue,
			MfDate dateSigned) throws ApplicationException {
		return Contract.save(new Contract(Product.find(productNumber), revenue,
				dateSigned));
	}

	@Override
	public void deleteContractInformation(long id) throws ApplicationException {
		Contract.delete(id);
	}

}
